<header id="header">
  <div id="header-main" class="header-inner">
    <div class="outer">
      <a href="{{ .Site.BaseURL }}" id="logo">
          {{ if .Site.Params.logo }}
          <i class="logo" style="background-image: url('{{ .Site.Params.logo | absURL }}')"></i>
          {{end}}
          <span class="site-title">{{ .Site.Title }}</span>
      </a>
      <nav id="main-nav">
          {{ range .Site.Params.menu }}
          {{ if .before }}
          <a class="main-nav-link" href="{{ .link | absURL }}">{{ .label }}</a>
          {{ end }}
          {{ end }}

          {{ range .Site.Menus.main }}
          <a class="main-nav-link" href="{{ .URL }}">{{ .Name }}</a>
          {{ end }}

          {{ range .Site.Params.menu }}
          {{ if not .before }}
          <a class="main-nav-link" href="{{ .link | absURL }}">{{ .label }}</a>
          {{ end }}
          {{ end }}
      </nav>
        <nav id="sub-nav">
          <div class="profile" id="profile-nav">
            <a id="profile-anchor" href="javascript:;"><img class="avatar" src="{{ .Site.Params.avatar | absURL }}"><i class="fa fa-caret-down"></i></a>
          </div>
        </nav>
        <div id="search-form-wrap">
          <form action="//google.com/search" method="get" accept-charset="UTF-8" class="search-form">
              <input type="search" name="q" class="search-form-input" placeholder="{{with .Site.Data.l10n.search.placeholder}}{{.}}{{end}}">
              <button type="submit" class="search-form-submit">
              </button>
              <input type="hidden" name="sitesearch" value="{{ .Site.BaseURL }}" />
         </form>
        </div>
    </div>
  </div>
  <div id="main-nav-mobile" class="header-sub header-inner">
    <table class="menu outer">
      <tbody>
          <tr>
          {{ range .Site.Params.menu }}
          {{ if .before }}
          <td><a class="main-nav-link" href="{{ .link | absURL }}">{{ .label }}</a></td>
          {{ end }}
          {{ end }}

          {{ range .Site.Menus.main }}
          <td><a class="main-nav-link" href="{{ .URL }}">{{ .Name }}</a></td>
          {{ end }}

          {{ range .Site.Params.menu }}
          {{ if not .before }}
          <td><a class="main-nav-link" href="{{ .link  | absURL }}">{{ .label }}</a></td>
          {{ end }}
          {{ end }}
          <td>
          <form action="//google.com/search" method="get" accept-charset="UTF-8" class="search-form">
          <input type="search" name="q" class="search-form-input" placeholder="Search">
          <input type="hidden" name="sitesearch" value="{{ .Site.BaseURL }}" />
          </form>
        </td>
      </tr>
      </tbody>
    </table>
  </div>
</header>
